package com.lemo.smart.bean;


import com.lemo.smart.util.CastUtil;

import java.util.Map;

/**
 * 封装请求参数对象
 * Created by 罗选通 on 2017/12/22.
 */
public class Param {

  private Map<String,Object> paramMap;

  public Param(Map<String, Object> paramMap) {
    this.paramMap = paramMap;
  }

  /**
   * 根据参数名获取long类型的值
   * @param name
   * @return
   */
  public long getLong(String name){
    Object o = paramMap.get(name);
    return CastUtil.castLong(o);
  }

  /**
   * 获取所有字段信息
   * @return
   */
  public Map<String, Object> getParamMap() {
    return paramMap;
  }


  public boolean isEmpty(){
    return paramMap.size()==0;
  }




}
